package net.hn.hnms.sys.orgnization.api.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.hn.hnms.biz.common.core.base.BaseDTO;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 组织机构DTO
 *
 * @author Jiangmf
 * @date 2019-11-02
 */
@Data
public class OrgDTO extends BaseDTO implements Serializable {

    /**
     * ID
     */
    @ApiModelProperty(value = "ID")
    @NotNull(groups = Update.class)
    private String id;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称")
    private String name;

    /**
     * 全称
     */
    @ApiModelProperty(value = "全称")
    private String fullname;

    /**
     * 树状上级ID
     */
    @ApiModelProperty(value = "父机构ID")
    private String pid;

    /**
     * 子机构列表
     */
    @ApiModelProperty(value = "子机构列表")
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<OrgDTO> children;

    /**
     * 是否启用
     */
    @ApiModelProperty(value = "是否启用")
    @NotNull
    private Boolean enabled;

}
